import socket
def get_base_url(ip, port):
    return f"http://{ip}:{port}"

def generate_url(ip, port, endpoint):
    base_url = get_base_url(ip, port)
    if endpoint.startswith('/'):
        endpoint = endpoint[1:]  # 移除开头的斜杠
    return f"{base_url}/{endpoint}/"

def get_shared_headers():
    return {
        "Content-Type": "application/json",
        "token": "10be84ed5f22482ffae176a80e05cc3d",
        "Operator": "81"
    }
def get_shared_ip():
    host_name = socket.gethostname()
    return socket.gethostbyname(host_name)

def get_shared_port():
    return "8008"